Connecting to Ingres from .NET

This section contains the following topics:

Required Software

Install the Data Provider into the Toolbox

Start the Ingres Data Adapter Configuration Wizard

Configure a Connection

Design a Query

Previous Topic

Next Topic

Required Software

The following software is required to connect to Ingres from .NET:

Note: The procedure in this guide shows how to connect using Visual Studio.

Previous Topic

Next Topic

Install the Data Provider into the Toolbox

The Ingres .NET Data Provider is integrated with Visual Studio 2005. Such integration allows a programmer to drag-and-drop the data provider design component onto a control, and to easily develop applications using wizards and editors.

The Ingres .NET Data Provider must be installed into the Visual Studio 2005 Toolbox before using it for the first time.

To install the data provider components into the Toolbox

  1. Create an empty Windows Form (Winform) application.
  2. Right-click the Data tab of the toolbox, and select Customize Toolbox.

    The Customize Toolbox dialog is displayed.

  3. Select the IngresCommand, IngresConnection, and IngresDataAdapter components on the .NET Framework Components tab, and then click OK.

    The Ingres .NET Data Provider components are installed in the Toolbox, as shown in this example:

    Data Provider Customize Toolbar

If the IngresCommand, IngresConnection, and IngresDataAdaper components do not appear in the Customize Toolbox dialog, you can add them.

To add the Ingres .NET Data Provider components to the Customize Toolbox dialog

  1. Click Browse on the Customize Toolbox dialog and browse to the directory C:\Program Files\Ingres\dotnet\assembly\v2.0.
  2. Open the Ingres.Client dll.

    The components are added.

Previous Topic

Next Topic

Start the Ingres Data Adapter Configuration Wizard

The Toolbox's Data tab lists the .NET data provider components that are available during the application's design.

To start the Ingres Data Adapter Configuration Wizard

  1. Drag the IngresDataAdapter component from the list on the Toolbox's Data tab onto the Windows Form design surface ("Form1").

    An "ingresDataAdapter1" component and its icon are added to the Visual Studio 2005 designer component tray.

    The welcome page of the Data Adapter Configuration Wizard is displayed.

    Data Adapter Config Wizard Welcome

Previous Topic

Next Topic

Configure a Connection

You must configure a connection string before connecting to a database using a .NET application.

Ingres Data Adapter Configuration Wizard assists you in specifying the design properties of the ingresDataAdapter1 component, including its connection string definition.

To define a connection string

  1. Click Next in the Data Adapter Configuration Wizard welcome screen.

    The Connection String Editor dialog is displayed.

    Connection String Editor Dialog

  2. Enter the connection information on the Connection tab:

Previous Topic

Next Topic

Design a Query

In the Data Adapter Configuration Wizard, you can enter your SQL command or use the Query Builder tool to generate the SELECT statement.

To design a query using the Query Builder

  1. Click Query Builder to develop your SELECT statement.

    The Add Table dialog opens.

  2. Click User Tables or All Tables.

    A list of available tables is displayed.

  3. Choose your table from the list, and then click Add, Close.

    Ingres Query Designer opens.

    The Ingres Query Designer has three horizontal panels:

  4. Enter column references you want to add to your query into any one of the three panels.

    The other two panels are automatically updated.

  5. Click OK.

    The query builder returns to the Ingres Data Adapter Wizard and displays the generated SELECT statement.

  6. Click Finish.

    The Ingres Data Adapter Wizard is closed.


© 2007 Ingres Corporation. All rights reserved.